<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>导入货位号</title>
</head>

<body>
<div style="padding: 10px;">

    <div class="panel panel-default">
        <div class="panel-heading">正在操作：导入货位号</div>
        <div class="panel-body">

            <form id="shelfImport_form" name="shelfImport_form" class="form-horizontal" action="/quanliadmin/app/wms/store.pscript?operFlg=11" method="POST" enctype="multipart/form-data">

                <div class="form-group">
                    <label for="storeID" class="col-sm-2 control-label">选择仓库 <font color="red">*</font></label>
                    <div class="col-sm-10">
                        <select class="form-control col-sm-2" id='storeID' name='storeID' style="width: 200px;">
                            <option value=''>请选择</option>
                            <!--{foreach from=$store_array item=value}-->
                            <option value='<!--{$value->storeID}-->'<!--{if $storeID == $value->storeID}--> selected <!--{/if}--> ><!--{$value->storeName}--></option>
                            <!--{/foreach}-->
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="search_file" class="col-sm-2 control-label">选择文件<font color="red">*</font></label>
                    <div class="col-sm-10">
                        <input  type="file"  id="search_file" name="search_file" style="height: 32px;" >
                    </div>

                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="button" class="btn btn-warning" name="into_sub" id="into_sub"  value="导入" />
                    </div>
                </div>

            </form>

        </div>
    </div>



</div>

<script type="text/javascript">

    $(document).ready(function(){

        $('#into_sub').click(function(){

            var storeID = $("#storeID").val();

            if( storeID == '' ){
                E.alert('请选择仓库');
                return false;
            }

            var filename = $('#search_file').val();
            if(filename == ''){
                E.alert('请选择CSV文件');
                return false;
            }

            var basename = filename.split(".");
            var fileType = basename[basename.length-1].toLowerCase();

            if( fileType != 'csv' ){
                E.alert("文件类型不正确,请选择CSV文件");
                return false;
            };

            document.getElementById('shelfImport_form').submit();
        })
    })

</script>

</body>

</html>
